import React from 'react';
import {connect} from 'dva/index';
import {Row, Col, Radio, DatePicker, Form, Input, InputNumber, Tabs} from 'antd';
import SingleDragger from "../../commons/SingleDragger";
import StreetSelect from '../StreetSelect';
import Constants from '../../../utils/Constants';
import moment from 'moment'
const dateFormat = 'YYYY-MM-DD';
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
const FormItem = Form.Item;
const TabPane = Tabs.TabPane;
const RadioGroup = Radio.Group;
const R = require("ramda");



const lgOdTrailer = Form.create()(class LgOdTrailer extends React.Component {
    constructor(props) {
        super(props);
    }

    handleResetFields = () => {
        this.props.form.resetFields();
    }

    handleConfirm = () => {
        this.props.form.validateFields({ force: true }, (errors, values) => {
           if (errors) return;
            let dataSource = this.props.logisticsOrder.dataSource.trailer ? this.props.logisticsOrder.dataSource.trailer : {};

            values.id = dataSource.id;
            if(values.trailerType === "1"){
                values.weighBillUrlUrl = this.refs.weighBillUrlUrl.getUrl();
                values.headstockPicUrl = this.refs.headstockPicUrl.getUrl();
                values.tailstockPicUrl = this.refs.tailstockPicUrl.getUrl();
                values.gpsUrl = this.refs.gpsUrl.getUrl();
                values.alsoCabinetBillUrl = this.refs.alsoCabinetBillUrl.getUrl();
                values.sendCarUrl = this.refs.sendCarUrl.getUrl();
                values.otherUrl = this.refs.otherUrl.getUrl();
            }else{
                values.signedReceiptUrl = this.refs.signedReceiptUrl.getUrl();
            }

            if (!R.equals(R.pick(Object.keys(values), dataSource), values)) {
                this.props.dispatch({
                    type: "logisticsOrder/updateOdTrailer",
                    payload: {
                        ...values,
                        onSuccess: ()=>{ this.props.handleCancel(); },
                        onFail: ()=>{ this.props.handleCancel(); }
                    },
                });
            }else {
                message.info("您未修改任何拖车信息！");
                //this.props.handleCancel();
            }
        })
    }


    render() {
        const { getFieldDecorator } = this.props.form;
        let dataSource = this.props.logisticsOrder.dataSource.trailer ? this.props.logisticsOrder.dataSource.trailer : {};
        let formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 } };
        let formItemLayout2 = { labelCol: { span: 4 }, wrapperCol: { span: 19 } };
        let formItemLayout3 = { labelCol: { span: 1 }, wrapperCol: { span: 22 } };

        let area = [];
        R.isNil(dataSource.provinceCode) ? "" : area.push(dataSource.provinceCode);
        R.isNil(dataSource.cityCode) ? "" : area.push(dataSource.cityCode);
        R.isNil(dataSource.districtCode) ? "" : area.push(dataSource.districtCode);
        R.isNil(dataSource.streetCode) ? "" : area.push(dataSource.streetCode);

        let module = "logistics";

        let weighBillUrlUrl = dataSource.weighBillUrlUrl ? dataSource.weighBillUrlUrl : undefined;
        let headstockPicUrl = dataSource.headstockPicUrl ? dataSource.headstockPicUrl : undefined;
        let tailstockPicUrl = dataSource.tailstockPicUrl ? dataSource.tailstockPicUrl : undefined;
        let gpsUrl = dataSource.gpsUrl ? dataSource.gpsUrl : undefined;
        let alsoCabinetBillUrl = dataSource.alsoCabinetBillUrl ? dataSource.alsoCabinetBillUrl : undefined;
        let sendCarUrl = dataSource.sendCarUrl ? dataSource.sendCarUrl : undefined;
        let otherUrl = dataSource.otherUrl ? dataSource.otherUrl : undefined;
        let signedReceiptUrl = dataSource.signedReceiptUrl ? dataSource.signedReceiptUrl : undefined;

        const divWithOutBorderBottom = {
            display: 'flex',
            borderRight: '1px solid #e9e9e9',
            borderLeft: '1px solid #e9e9e9',
            borderTop: '1px solid #e9e9e9',
            borderSpacing: 0,
            lineHeight: 3.5,
            textAlign: 'left',
        }

        const columnBreak = {
            display: 'flex',
            borderRight: '1px solid #e9e9e9',
            borderLeft: '1px solid #e9e9e9',
            borderTop: '1px solid #e9e9e9',
            borderSpacing: 0,
            textAlign: 'left',
        }

        return (
            <div>
                <Form>
                    <Row>
                        <Col span={12}>
                            <FormItem {...formItemLayout} label='拖车方式' >
                                {getFieldDecorator('trailerType', {
                                    rules: [{
                                        required: false, message: '请选择拖车方式！',
                                    }],
                                    initialValue: "1"
                                })(
                                    <RadioGroup disabled={this.props.disabled}>
                                        <Radio value="1">整柜</Radio>
                                        <Radio value="2">散货</Radio>
                                    </RadioGroup>
                                )}
                            </FormItem>
                        </Col>
                    </Row>


                    {this.props.form.getFieldValue("trailerType") == "1" ?
                        <div>
                            <Tabs tabPosition={'top'}>
                                <TabPane tab="制定整柜拖车计划" key="1">
                                    {/*<Row>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="供应商名称" hasFeedback>*/}
                                                {/*{getFieldDecorator('trailerSupplierName', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: true, message: '请输入供应商名称',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.trailerSupplierName*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="100" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="下单时间" hasFeedback>*/}
                                                {/*{getFieldDecorator('receiptCreatetime', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: true, message: '请选择下单时间'*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: (R.isNil(dataSource.receiptCreatetime) || R.isEmpty(dataSource.receiptCreatetime)) ? undefined : moment(dataSource.receiptCreatetime, dateFormat)*/}
                                                {/*})(*/}
                                                    {/*<DatePicker disabled={this.props.disabled}*/}
                                                                {/*style={{ width: '100%' }}*/}
                                                                {/*showTime={{ format: 'YYYY-MM-DD' }}*/}
                                                                {/*format="YYYY-MM-DD" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    {/*<Row>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="拖车下单人" hasFeedback>*/}
                                                {/*{getFieldDecorator('receiptCreator', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: true, message: '请输入拖车下单人',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.receiptCreator*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="100" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="BL(SO)" hasFeedback>*/}
                                                {/*{getFieldDecorator('soNo', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: true, message: '请输入BL(SO)',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.soNo*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="50" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    <Row>
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="货名">*/}
                                                {/*{getFieldDecorator('productName', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: true, message: '请输入货名',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.productName*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="50" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="重量(kg)" hasFeedback>
                                                {getFieldDecorator('weight', {
                                                    rules: [{
                                                        required: false, message: '请输入重量',
                                                    }],
                                                    initialValue: dataSource.weight
                                                })(
                                                    <InputNumber min={0} disabled={this.props.disabled} style={{ width: '100%' }} maxLength="18" />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="过磅重量(kg)" hasFeedback>
                                                {getFieldDecorator('weighWeight', {
                                                    rules: [{
                                                        required: false, message: '请输入过磅重量',
                                                    }],
                                                    initialValue: dataSource.weighWeight
                                                })(
                                                    <InputNumber min={0}
                                                                 disabled={this.props.disabled}
                                                                 style={{width: '100%'}} maxLength="18"/>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    {/*<Row>*/}
                                        {/*<Col span={2} style={{ marginLeft: 80 }}>*/}
                                            {/*<span><font size="2">柜型/柜量:</font></span>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={4}>*/}
                                            {/*<FormItem {...formItemLayout3}>*/}
                                                {/*{getFieldDecorator('size20gp', {*/}
                                                    {/*initialValue: dataSource.size20gp*/}
                                                {/*})(*/}
                                                    {/*<InputNumber disabled={this.props.disabled} min={0} maxLength="4" style={{ width: '100%' }} />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={2}>*/}
                                            {/*<span><font size="2">*20GP</font></span>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={4}>*/}
                                            {/*<FormItem {...formItemLayout3}>*/}
                                                {/*{getFieldDecorator('size40gp', {*/}
                                                    {/*initialValue: dataSource.size40gp*/}
                                                {/*})(*/}
                                                    {/*<InputNumber disabled={this.props.disabled} min={0} maxLength="4" style={{ width: '100%' }} />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={2}>*/}
                                            {/*<span><font size="2">*40GP</font></span>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={4}>*/}
                                            {/*<FormItem {...formItemLayout3}>*/}
                                                {/*{getFieldDecorator('size40hq', {*/}
                                                    {/*initialValue: dataSource.size40hq*/}
                                                {/*})(*/}
                                                    {/*<InputNumber disabled={this.props.disabled} min={0} maxLength="4" style={{ width: '100%' }} />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={2}>*/}
                                            {/*<span><font size="2">*40HQ</font></span>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="提柜地点">
                                                {getFieldDecorator('raiseCabinetAddress', {
                                                    rules: [{
                                                        required: false, message: '请输入提柜地点',
                                                    }],
                                                    initialValue: dataSource.raiseCabinetAddress
                                                })(
                                                    <Input disabled={this.props.disabled} maxLength="150" />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="还柜地点" hasFeedback>
                                                {getFieldDecorator('alsoCabinetAddress', {
                                                    rules: [{
                                                        required: false, message: '请输入还柜地点',
                                                    }],
                                                    initialValue: dataSource.alsoCabinetAddress
                                                })(
                                                    <Input disabled={this.props.disabled} maxLength="150" />
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    {/*<Row>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="装柜地址" hasFeedback>*/}
                                                {/*{getFieldDecorator('area', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: false, message: '请选择装柜地址',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: area*/}
                                                {/*})(*/}
                                                    {/*<StreetSelect style={{ width: "100%" }} disabled={this.props.disabled} />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="装柜时间" hasFeedback>*/}
                                                {/*{getFieldDecorator('wholeLoadingTime', {*/}
                                                    {/*initialValue: (R.isNil(dataSource.loadingTime) || R.isEmpty(dataSource.loadingTime)) ? undefined : moment(dataSource.loadingTime, timeFormat)*/}
                                                {/*})(*/}
                                                    {/*<DatePicker disabled={this.props.disabled}*/}
                                                                {/*style={{ width: '100%', marginBottom: 5 }}*/}
                                                                {/*showTime={{ defaultValue: moment('00:00:00', 'HH:mm:ss') }}*/}
                                                                {/*format="YYYY-MM-DD HH:mm:ss"*/}
                                                    {/*/>*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    {/*<Row>*/}
                                        {/*<Col span={24}>*/}
                                            {/*<FormItem {...formItemLayout2} label="装柜详细地址" hasFeedback>*/}
                                                {/*{getFieldDecorator('detailAddress', {*/}
                                                    {/*rules: [{*/}
                                                        {/*required: false, message: '请输入装柜详细地址',*/}
                                                    {/*}],*/}
                                                    {/*initialValue: dataSource.detailAddress*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="300" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    {/*<Row>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="装柜联系人" hasFeedback>*/}
                                                {/*{getFieldDecorator('loadingContacts', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: false, message: '请输入联系人/方式',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.loadingContacts*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="50" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="联系方式" hasFeedback>*/}
                                                {/*{getFieldDecorator('loadingTelephone', {*/}
                                                    {/*// rules: [{*/}
                                                    {/*//     required: false, message: '请输入联系人/方式',*/}
                                                    {/*// }],*/}
                                                    {/*initialValue: dataSource.loadingTelephone*/}
                                                {/*})(*/}
                                                    {/*<Input disabled={this.props.disabled} maxLength="50" />*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="监装人" hasFeedback>
                                                {getFieldDecorator('checkContacts', {
                                                    rules: [{
                                                        required: false, message: '请输入监装人',
                                                    }],
                                                    initialValue: dataSource.checkContacts
                                                })(
                                                    <Input disabled={this.props.disabled} maxLength="18" />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="拖车费" hasFeedback>
                                                {getFieldDecorator('trailerFee', {
                                                    rules: [{
                                                        required: false, message: '请输入拖车费',
                                                    }],
                                                    initialValue: dataSource.trailerFee
                                                })(
                                                    <InputNumber disabled={this.props.disabled} maxLength="18" style={{ width: '100%' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={24}>
                                            <FormItem {...formItemLayout2} label="特殊要求" hasFeedback>
                                                {getFieldDecorator('requireDesc', {
                                                    rules: [{
                                                        required: false, message: '请输入特殊要求',
                                                    }],
                                                    initialValue: dataSource.requireDesc
                                                })(
                                                    <Input.TextArea disabled={this.props.disabled} maxLength="300" autosize={{ minRows: 2, maxRows: 5 }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </TabPane>
                            </Tabs>

                            <Tabs tabPosition={'top'}>
                                <TabPane tab="整柜拖车凭证" key="1">
                                    {/*<Row>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="柜号" hasFeedback>*/}
                                                {/*{getFieldDecorator('cntrNo', {*/}
                                                    {/*rules: [{*/}
                                                        {/*required: false, message: '请输入柜号',*/}
                                                    {/*}],*/}
                                                    {/*initialValue: dataSource.cntrNo*/}
                                                {/*})(*/}
                                                    {/*<Input*/}
                                                        {/*disabled={this.props.disabled}*/}
                                                        {/*maxLength="300"/>*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={12}>*/}
                                            {/*<FormItem {...formItemLayout} label="封号" hasFeedback>*/}
                                                {/*{getFieldDecorator('sealNumber', {*/}
                                                    {/*rules: [{*/}
                                                        {/*required: false, message: '请输入封号',*/}
                                                    {/*}],*/}
                                                    {/*initialValue: dataSource.sealNumber*/}
                                                {/*})(*/}
                                                    {/*<Input*/}
                                                        {/*disabled={this.props.disabled}*/}
                                                        {/*maxLength="50"/>*/}
                                                {/*)}*/}
                                            {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    {/*</Row>*/}
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="过磅单"
                                                      hasFeedback>
                                                <SingleDragger url={weighBillUrlUrl} ref="weighBillUrlUrl"
                                                               dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="车头照"
                                                      hasFeedback>
                                                <SingleDragger url={headstockPicUrl} ref="headstockPicUrl"
                                                               dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="车尾照"
                                                      hasFeedback>
                                                <SingleDragger url={tailstockPicUrl} ref="tailstockPicUrl"
                                                               dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="GPS定位"
                                                      hasFeedback>
                                                <SingleDragger url={gpsUrl} ref="gpsUrl" dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="还柜纸"
                                                      hasFeedback>
                                                <SingleDragger url={alsoCabinetBillUrl} ref="alsoCabinetBillUrl"
                                                               dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="派车单"
                                                      hasFeedback>
                                                <SingleDragger url={sendCarUrl} ref="sendCarUrl" dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout}
                                                      label="其他材料"
                                                      hasFeedback>
                                                <SingleDragger url={otherUrl} ref="otherUrl" dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </TabPane>
                            </Tabs>
                        </div>
                        : ""}


                    {this.props.form.getFieldValue("trailerType") == "2" ?
                        <div>
                            <Tabs tabPosition={'top'}>
                                <TabPane tab="散货托运单" key="1">
                                    <div style={{ width: '90%', marginLeft: 50 }}>
                                        <div style={{ textAlign: 'center' }}>
                                            <div><span><b><font size="5">托运单</font></b></span></div>
                                            <div style={{ marginTop: 10 }}><span><b><font size="3">广州瀚森乐达供应链管理有限公司</font></b></span></div>
                                        </div>
                                        <div style={{ textAlign: 'left', marginTop: 10, marginBottom: 10 }}>
                                            <div><span>TO: {dataSource.trailerSupplierName? dataSource.trailerSupplierName + "车队" : null}</span></div>
                                            <div style={{ marginTop: 10 }}><span>FM: {dataSource.gdUser ? dataSource.gdUser+ "/" : null}{dataSource.gdTelephone}</span></div>
                                            <div style={{ marginTop: 10 }}><span>下单日期: {dataSource.receiptCreatetime}</span></div>
                                        </div>
                                        <div style={divWithOutBorderBottom}>
                                            <div style={{ width: '17%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>委托送货方</div>
                                            </div>
                                            <div style={{ width: '17%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>广州瀚森乐达</div>
                                            </div>
                                            <div style={{ width: '16%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>联系人</div>
                                            </div>
                                            <div style={{ width: '16%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>{dataSource.gdUser}</div>
                                            </div>
                                            <div style={{ width: '17%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>联系电话</div>
                                            </div>
                                            <div style={{ width: '17%', marginLeft: 10 }}>
                                                <span>
                                                    {getFieldDecorator('gdTelephone', {
                                                        initialValue: dataSource.gdTelephone
                                                    })(
                                                        <Input maxLength="15" disabled={this.props.disabled} style={{ width: '90%', marginBottom: 5 }} />
                                                    )}
                                                </span>
                                            </div>
                                        </div>

                                        {/*<div style={divWithOutBorderBottom}>*/}
                                            {/*<div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>*/}
                                                {/*<div>装柜地址 &nbsp;&nbsp;*/}
                                                    {/*<span>*/}
                                                        {/*{getFieldDecorator('detailAddress', {*/}
                                                            {/*initialValue: dataSource.detailAddress*/}
                                                        {/*})(*/}
                                                            {/*<Input maxLength="100" disabled={this.props.disabled} style={{ width: '90%', marginBottom: 5 }} />*/}
                                                        {/*)}*/}
                                                    {/*</span>*/}
                                                {/*</div>*/}
                                            {/*</div>*/}
                                        {/*</div>*/}
                                        {/*<div style={divWithOutBorderBottom}>*/}
                                            {/*<div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>*/}
                                                {/*<div> 联系人 &nbsp;&nbsp;*/}
                                                    {/*<span>*/}
                                                        {/*{getFieldDecorator('loadingContacts', {*/}
                                                            {/*initialValue: dataSource.loadingContacts*/}
                                                        {/*})(*/}
                                                            {/*<Input maxLength="50" disabled={this.props.disabled} style={{ width: '90%', marginLeft: 12, marginBottom: 5 }} />*/}
                                                        {/*)}*/}
                                                    {/*</span>*/}
                                                {/*</div>*/}
                                            {/*</div>*/}
                                        {/*</div>*/}

                                        {/*<div style={divWithOutBorderBottom}>*/}
                                            {/*<div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>*/}
                                                {/*<div> 联系人电话 &nbsp;*/}
                                                    {/*<span>*/}
                                                        {/*{getFieldDecorator('loadingTelephone', {*/}
                                                            {/*initialValue: dataSource.loadingTelephone*/}
                                                        {/*})(*/}
                                                            {/*<Input maxLength="20" disabled={this.props.disabled} style={{ width: '89%', marginBottom: 5 }} />*/}
                                                        {/*)}*/}
                                                    {/*</span>*/}
                                                {/*</div>*/}
                                            {/*</div>*/}
                                        {/*</div>*/}

                                        {/*<div style={divWithOutBorderBottom}>*/}
                                            {/*<div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>*/}
                                                {/*<div> 装货时间 &nbsp;&nbsp;*/}
                                                    {/*<span>*/}
                                                        {/*{getFieldDecorator('loadingTime', {*/}
                                                            {/*initialValue: (R.isNil(dataSource.loadingTime) || R.isEmpty(dataSource.loadingTime)) ? undefined : moment(dataSource.loadingTime, timeFormat)*/}
                                                        {/*})(*/}
                                                            {/*<DatePicker disabled={this.props.disabled}*/}
                                                                        {/*style={{ width: '90%', marginBottom: 5 }}*/}
                                                                        {/*showTime={{ defaultValue: moment('00:00:00', 'HH:mm:ss') }}*/}
                                                                        {/*format="YYYY-MM-DD HH:mm:ss"*/}
                                                                        {/*placeholder="请选择有效截止时间" />*/}
                                                        {/*)}*/}
                                                    {/*</span>*/}
                                                {/*</div>*/}
                                            {/*</div>*/}
                                        {/*</div>*/}

                                        <div style={divWithOutBorderBottom}>
                                            <div style={{ width: '35%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 卸货人公司名称 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('unloadCompany', {
                                                            initialValue: dataSource.unloadCompany
                                                        })(
                                                            <Input maxLength="100" disabled={this.props.disabled} style={{ width: '62%', marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                            <div style={{ width: '32%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 联系人 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('unloadContacts', {
                                                            initialValue: dataSource.unloadContacts
                                                        })(
                                                            <Input maxLength="100" disabled={this.props.disabled} style={{ width: '72%', marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                            <div style={{ width: '33%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 联系电话 &nbsp;
                                                    <span>
                                                        {getFieldDecorator('unloadTelephone', {
                                                            initialValue: dataSource.unloadTelephone
                                                        })(
                                                            <Input maxLength="20" disabled={this.props.disabled} style={{ width: '70%', marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div style={divWithOutBorderBottom}>
                                            <div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 卸货地址 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('unloadAddress', {
                                                            initialValue: dataSource.unloadAddress
                                                        })(
                                                            <Input maxLength="200" disabled={this.props.disabled} style={{ width: '90%', marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div style={Object.assign({}, { lineHeight: 5 }, columnBreak)}>
                                            {/*<div style={{ width: '45%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>*/}
                                                {/*<div> 货物名称 &nbsp;&nbsp;*/}
                                                    {/*<span>*/}
                                                        {/*{getFieldDecorator('productName', {*/}
                                                            {/*initialValue: dataSource.productName*/}
                                                        {/*})(*/}
                                                            {/*<Input.TextArea maxLength="50" disabled={this.props.disabled} style={{ width: '80%', marginTop: 5, marginBottom: 5 }} autosize={{ minRows: 5, maxRows: 6 }} />*/}
                                                        {/*)}*/}
                                                    {/*</span>*/}
                                                {/*</div>*/}
                                            {/*</div>*/}
                                            <div style={{ width: '45%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 大约重量 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('probablyWeight', {
                                                            initialValue: dataSource.probablyWeight
                                                        })(
                                                            <InputNumber maxLength="18" disabled={this.props.disabled} style={{ width: '60%', marginTop: 5, marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                                <div style={{ borderTop: '1px solid #e9e9e9' }}> 大约件数 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('probablyPackagesNum', {
                                                            initialValue: dataSource.probablyPackagesNum
                                                        })(
                                                            <InputNumber maxLength="11" disabled={this.props.disabled} style={{ width: '60%', marginTop: 5, marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                            <div style={{ width: '55%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 大约方数 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('probablyCube', {
                                                            initialValue: dataSource.probablyCube
                                                        })(
                                                            <InputNumber maxLength="18" disabled={this.props.disabled} style={{ width: '65%', marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                                <div style={{ borderTop: '1px solid #e9e9e9' }}> 货物包装 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('cargoPackages', {
                                                            initialValue: dataSource.cargoPackages
                                                        })(
                                                            <Input maxLength="15" disabled={this.props.disabled} style={{ width: '65%', marginTop: 5, marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>

                                        <div style={Object.assign({}, { lineHeight: 5 }, columnBreak)}>
                                            <div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>备注 &nbsp;
                                                    <span>
                                                        {getFieldDecorator('unloadMemo', {
                                                            initialValue: dataSource.unloadMemo
                                                        })(
                                                            <Input.TextArea maxLength="200" disabled={this.props.disabled} style={{ width: '92%', marginTop: 5, marginLeft: 22, marginBottom: 5 }} autosize={{ minRows: 3, maxRows: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>

                                        <div style={Object.assign({}, { lineHeight: 4 }, columnBreak)}>
                                            <div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div> 提货费 &nbsp;&nbsp;
                                                    <span>
                                                        {getFieldDecorator('pickUpCharge', {
                                                            initialValue: dataSource.pickUpCharge
                                                        })(
                                                            <InputNumber maxLength="18" disabled={this.props.disabled} style={{ width: '92%', marginTop: 5, marginBottom: 5 }} />
                                                        )}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>

                                        <div style={divWithOutBorderBottom}>
                                            <div style={{ width: '100%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div><font size="2.5">托运人须知： 门到门服务，每趟运输太平洋保险公司承保100万，货物价值超过100万需要及时告诉我公司，具体办法根据我公司与保险公司签订的协议处理。</font></div>
                                            </div>
                                        </div>

                                        <div style={divWithOutBorderBottom}>
                                            <div style={{ width: '33%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>托运人签名(盖章)</div>
                                            </div>
                                            <div style={{ width: '33%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>承运人签名(盖章)</div>
                                            </div>
                                            <div style={{ width: '34%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>收货人签名(盖章)</div>
                                            </div>
                                        </div>

                                        <div style={Object.assign({}, { lineHeight: 10, borderBottom: '1px solid #e9e9e9' }, columnBreak)}>
                                            <div style={{ width: '33%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>年 &nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp; 日</div>
                                            </div>
                                            <div style={{ width: '33%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>年 &nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp; 日</div>
                                            </div>
                                            <div style={{ width: '34%', marginLeft: 10, borderRight: '1px solid #e9e9e9' }}>
                                                <div>年 &nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp; 日</div>
                                            </div>
                                        </div>
                                    </div>
                                </TabPane>
                            </Tabs>

                            <Tabs tabPosition={'top'}>
                                <TabPane tab="散货运输凭证" key="1">
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="司机姓名" hasFeedback>
                                                {getFieldDecorator('driverName', {
                                                    rules: [{
                                                        required: false, message: '请输入司机姓名',
                                                    }],
                                                    initialValue: dataSource.driverName
                                                })(
                                                    <Input
                                                        disabled={this.props.disabled}
                                                        maxLength="50"/>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="联系电话" hasFeedback>
                                                {getFieldDecorator('driverTelephone', {
                                                    rules: [{
                                                        required: false, message: '请输入联系电话',
                                                    }],
                                                    initialValue: dataSource.driverTelephone
                                                })(
                                                    <Input
                                                        disabled={this.props.disabled}
                                                        maxLength="20" style={{width: '100%'}}/>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="车牌号码" hasFeedback>
                                                {getFieldDecorator('carNum', {
                                                    rules: [{
                                                        required: false, message: '请输入车牌号码',
                                                    }],
                                                    initialValue: dataSource.carNum
                                                })(
                                                    <Input
                                                        disabled={this.props.disabled}
                                                        maxLength="20" style={{width: '100%'}}/>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={12}>
                                            <FormItem {...formItemLayout} label="签收单" hasFeedback>
                                                <SingleDragger url={signedReceiptUrl}
                                                               ref="signedReceiptUrl"
                                                               dataSource={dataSource}
                                                               module={module}
                                                               disabled={this.props.disabled}/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </TabPane>
                            </Tabs>
                        </div>
                        : ""}
                </Form>
            </div>
        )
    }
})


function mapStateToProps(state) {
    return {
        loading: state.loading.models.logisticsOrder, logisticsOrder: state.logisticsOrder
    };
}

export default connect(mapStateToProps)(lgOdTrailer);